package com.example.demo.service.impl;

import com.example.demo.mapper.SpringBootMapper;
import com.example.demo.model.Material;
import com.example.demo.service.SpringBootService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/12/26.
 */
@Service
public class SprintBootServiceImpl implements SpringBootService {

    @Autowired
    private SpringBootMapper springBootMapper;
    @Override
    public List<Material> queryAll() {
        return springBootMapper.queryAll();
    }

    @Override
    public List<Material> batchQueryMaterials(List<Integer> ids) {
        return springBootMapper.batchQueryMaterials(ids);
    }

    @Override
    public List<Material> batchAddMaterials(List<Material> materials) {
        springBootMapper.batchAddMaterials(materials);
        return materials;
    }

    @Override
    public String batchDeleteMaterialsByIds(List<Integer> ids) {
        springBootMapper.batchDeleteMaterialsByIds(ids);
        return "1";
    }

    @Override
    public List<Material> batchUpdateMaterialByIds(List<Material> materials) {
        springBootMapper.batchUpdateMaterialByIds(materials);
        return materials;
    }

    @Override
    public List<Material> zhuJieBatchQueryMaterials(List<Integer> ids) {
        return springBootMapper.zhuJieBatchQueryAllByIds(ids);
    }


}
